package cn.tedu._04mybatis.pojo;

import java.util.Date;
import java.util.List;

/**
 * 使用当前对象表达用户和对应微博的关联查询结果
 * User表语Weibo表是一个一对多关系，即：一个用户记录可以对应多个微博记录
 * 那么这里设计时：
 * UserVO1中定义属性先表示用户自身信息
 * 然后再设计一个List集合，保存该用户对应的所有微博信息。
 * 因此一个UserVO4对象可以对应多个Weibo对象从而正确表达一对多的关系。
 */
public class UserVO1 {
    private Integer id;
    private String username;
    private String password;
    private String nickname;
    private Date created;
    /**
     * 微博集合
     */
    private List<Weibo> weiboList;

    public UserVO1() {
    }

    public UserVO1(Integer id, String username, String password, String nickname, Date created, List<Weibo> weiboList) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.nickname = nickname;
        this.created = created;
        this.weiboList = weiboList;
    }

    @Override
    public String toString() {
        return "UserVO1{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", nickname='" + nickname + '\'' +
                ", created=" + created +
                ", weiboList=" + weiboList +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public List<Weibo> getWeiboList() {
        return weiboList;
    }

    public void setWeiboList(List<Weibo> weiboList) {
        this.weiboList = weiboList;
    }
}
